<?php
/* 
 * ********* CVS HEADER ********* 
 * 
 * $RCSfile: admuserautomod.php,v $ 
 * $Date: 2005/08/29 15:29:48 $ 
 * $Revision: 1.2 $ 
 * 
 * ********* CVS HEADER ********* 
 */
require_once ("module/TPLN/TPLN.php");
$TPLN = new TPLN;

$TPLN -> Open($op_basepath."tpl/admuserautomod.html");
$TPLN -> IncludeFile("header", "environnement/".$session["environnement"]."/header.php");
$TPLN -> IncludeFile("footer", "environnement/".$session["environnement"]."/footer.php");

include ("param/autouser.php");

if ($confirm == 1) {
	$mod = 0;
	if ($m_prototype != $prototype) {
		$prototype = $m_prototype;
		$mod = 1;
	}
	if ($m_del != $del) {
		$del = $m_del;
		$mod = 1;
	}
	if (file_exists($m_file) && ($m_file != '')) {
		move_uploaded_file($m_file, $m_myScript);
	}
	if ($m_myScript != $myScript) {
		$myScript = $m_myScript;
		$mod = 1;
	}
	if ($m_exit_file != $exit_file) {
		$exit_file = $m_exit_file;
		$mod = 1;
	}
	if ($mod == 1) {
		$f = fopen("param/autouser.php", "w");
		fputs($f, "<?php\n");
		fputs($f, "\$prototype = '$prototype';\n");
		fputs($f, "\$del = '$del';\n");
		fputs($f, "\$myScript = '$myScript';\n");
		fputs($f, "\$exit_file = '$exit_file';\n");
		fputs($f, "?>");
		fclose($f);
	}
	header("Location: ?op=admuserauto");
	exit;
}

$TPLN -> Parse("prototype", $prototype);
$TPLN -> Parse("del", $del);
$TPLN -> Parse("script", $myScript);
$TPLN -> Parse("exit_file", $exit_file);

$TPLN -> Write();

?>